<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>g构造函数原理</title>
</head>
<body>
  <script>
    //
    function Student(name, age, sex) {
      // 1. var this = {}
      this.name = name
      this.age = age
      this.sex = sex
      this.grade = 2021
      // 2. return this
    }
    var student = new Student('ysy', 18, 'male')
  </script>
</body>
</html>